<?php
require_once 'code/RestService.php';
require_once 'code/Topic.php';

function read($id) {
	$topic = new Topic();
	$topic->load($id);
	return $topic->getData();
}

function add($data) {
	return false;
}

$server = new RestService();
$server->addFunction('read'); 
$server->addFunction('add'); 
$server->handle();
?>